<template>
  <div class="address-main">
    <div class="address-header">
      <span @click="goBack"><van-icon name="arrow-left" /></span>
      <div class="center">{{ $t('h.MY_COLLECTP_SHOP_TITLE') }}</div>
    </div>
    <div class="shop-box">
      <div class="shop-store">
        <div class="shop-item" v-for="item in stores" @click="$router.push({path:'/store/' + item.id})">
          <div class="shop-up">
            <img :src="item.avatar" alt="">
            <div class="box-right">
              <div class="left">
                <p class="shop-name">{{item.title}}</p>
<!--                <p class="shop-love">{{ $t('h.SELL_COUNT') }}：{{item.sales_data}}</p>-->
                <p class="shop-goods shop-love">{{ $t('h.PRODUCT_COUNT') }}：{{item.count}}</p>
              </div>
              <div class="right">
                <button > {{ $t('h.VISIT_THIS_STORE') }}  > </button>
              </div>
            </div>
          </div>
          <div class="shop-bottom">
            <span> {{ $t('h.REPUTATION_POINTS') }}: {{item.xinyufen}}</span>
            <span> {{ $t('h.SELL_COUNT') }}: {{item.sales_data}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {getUerFavStores} from '@/api/apiFox';

export default {
  data(){
    return{
      active:0,
      stores:[]
    }
  },
  mounted() {
    this.getDatas();
  },
  methods:{
    getDatas(){
      getUerFavStores().then(res => {
        this.stores = res.data
      })
    },
    goBack(){
      this.$router.go(-1)
    },
  }
}
</script>

<style scoped lang="scss">
.address-main {
  width: 100%;
  min-height: 100vh;
  background: #fff;

  .address-header {
    width: 100%;
    height: 45px;
    display: flex;
    background: #fff;
    justify-content: center;
    align-items: center;
    position: relative;

    span {
      position: absolute;
      left: 10px;
    }

    .center {
      width: 100%;
      height: 45px;
      text-align: center;
      line-height: 45px;
      font-size: 15px;
    }
  }
  .shop-box{
    width: 100%;
    padding: 3% 5%;
    box-sizing: border-box;
    .shop-store{
      width: 100%;
      .shop-item{
        width: 100%;
        min-height: 100px;
        border: 1px solid #f6f6f6;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 2% 3%;
        box-sizing: border-box;
        .shop-up{
          width: 100%;
          display: flex;
          padding: 0 0 15px 0;
          justify-content: space-between;
          border-bottom: 1px solid #f6f6f6;
          img{
            width: 60px;
            height: 60px;
            border-radius: 50%;
          }
          .box-right{
            width: 80%;
            height: 60px;
            display: flex;
            align-items: center;

            .left{
              width: 80%;
              padding: 0 0 0 15px;
              box-sizing: border-box;
              .shop-name{
                font-size: 16px;
                margin: 5px 0;
              }
              .shop-love{
                font-size: 12px;
                color: #999999;
              }
            }
            .right{
              width: 100px;
              height: 60px;
              display: flex;
              justify-content: center;
              align-items: center;
              button{
                height: 24px;
                padding: 5px 10px;
                border-radius: 24px;
                display: flex;
                justify-content: center;
                align-items: center;
                text-align: center;
                border: none;
                background: #002FFF;
                color: #fff;
                font-size: 12px;
                white-space: nowrap;
              }
            }
          }
        }
        .shop-bottom{
          width: 100%;
          display: flex;
          margin-top: 5px;
          justify-content: space-between;
          align-items: center;
          span{
            font-size: 10px;
            color: #999;

          }
        }
      }
    }
  }

}
</style>
